package com.guapi.util;

public class RedisKeyUtil {
    private static final String SPLIT = ":";
    private static final String PREFIX_KAPTCHA = "kaptcha";
    private static final String PREFIX_TICKET = "ticket";
    private static final String PREFIX_USER = "user";
    private static final String CART = "cart";


    //返回kaptcha-验证码
    public static String getKaptchaKey(String owner) {
        return PREFIX_KAPTCHA + SPLIT + owner;
    }

    public static String getLoginTicketKey(String ticket) {
        return PREFIX_TICKET + SPLIT + ticket;
    }

    //用户-购物车-->user:userId:cart->zset
    public static String getUserShoppingCartKey(int userId){
        return PREFIX_USER+SPLIT+userId+SPLIT+CART;
    }
}
